1. Field of the Disclosure
This disclosure generally relates to a communication system and an optical navigation device and, more particularly, to a communication system and an optical navigation device capable of dynamically adjusting the data transmission format.
2. Description of the Related Art
An optical mouse utilizes a light source and an image sensor to detect a movement with respect to a tracking surface under the optical mouse. FIG. 1 shows a schematic block diagram of a conventional optical mouse. As shown in FIG. 1, the conventional optical mouse 1 includes a microprocessor 11 and an optical sensing module 12, wherein the microprocessor 11 and the optical sensing module 12 are connected together through a serial peripheral interface bus (SPI bus) 13. Generally, the SPI bus 13 may be a four-wire serial bus or a two-wire serial bus. The microprocessor 12 may acquire the displacement data obtained by the optical sensing module 12 via the SPI bus 13.
FIG. 2 shows a timing diagram of the read operation of a two-wire serial bus. When the SPI bus 13 is the two-wire serial bus, it may include a serial clock (SCLK) line and a serial data (SDA) line. The microprocessor 11 and the optical sensing module 12 may be designed to transmit data in 8-bit words. The microprocessor 11 issues a clock signal via the SCLK line. Each time the microprocessor 11 reads displacement data, totally 8 bytes of data including 2 bytes of synchronization data, 2 bytes of update data and 4 bytes of displacement data have to be transmitted on the SDA line, wherein the synchronization data and the update data have to include an address data 21 and 22 respectively, and the displacement data have to include the address data 23 related to an x-displacement and the address data 24 related to a y-displacement. If the transmission speed is 200 kHz, it needs to take 355 μs to transmit 8 bytes of data. Although it may use fewer I/O ports and spend lower cost to transmit data by using a two-wire serial bus, a longer transmission time is required to transmit the displacement data and it is not able to ensure the synchronization of the data transmission.
FIG. 3 shows a timing diagram of the read operation of a four-wire serial bus. When the SPI bus 13 is the four-wire serial bus, it may include a serial clock (SCLK) line, a master output slave input (MOSI) line, a master input slave output (MISO) line and a slave select (SS) line. Each time the microprocessor 11 reads displacement data, the microprocessor 11 sets the SS line to logic low and issues a clock signal via the SCLK line, and then sends the address data (31, 32 and 33) and data to the optical sensing module 12 via the MOSI line and receives the updated data, x-displacement and y-displacement from the optical sensing module 12 via the MISO line. As the synchronization data is no longer required, a shorter transmission time can be realized. That is, if the transmission speed is 200 kHz and a guide time is 5 μs, it still takes 265 μs to transmit data in 8-bit words. More I/O ports and a higher cost are necessary to transmit data by using a four-wire serial bus and a long transmission time is still required.